package grammar;

import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.TokenStream;

import gen.SampleLexer;
import gen.SampleParser;

public class Test {

	public static void main(String[] args) throws RecognitionException {
		CharStream charStream = new ANTLRStringStream("3*2+	4");
		SampleLexer lexer  = new SampleLexer(charStream);
		TokenStream tockenStream = new CommonTokenStream(lexer);
		SampleParser parser = new SampleParser(tockenStream ); 
		int result = parser.evalueter();
		System.out.println("done! " + result);
	}
}
